package com.fafu.rbac.conterter;

import com.fafu.common.web.converter.BaseConverter;
import com.fafu.rbac.domain.entity.Role;
import com.fafu.rbac.domain.vo.RoleVO;

public class RoleConverter extends BaseConverter<Role, RoleVO> {
    @Override
    protected RoleVO entity2VO(Role role) {
        if (role == null) {
            return null;
        }
        RoleVO roleVO = new RoleVO();
        roleVO.setId(role.getId());
        roleVO.setName(role.getName());
        roleVO.setCode(role.getCode());
        roleVO.setState(role.getState());
        roleVO.setCreateTime(role.getCreateTime());
        roleVO.setUpdateTime(role.getUpdateTime());
        return roleVO;
    }
}
